class Animal{
    public String name;
    public void eat(){
        System.out.println("Animal::eat");
    }
}
class Dog extends Animal{
    public void eat(){
        System.out.println("Dog::eat");
    }
}
class Bird extends Animal{
    public void eat(){
        System.out.println("Bird::eat");
    }
    public void fly(){
        System.out.println("Bird::fly");
    }
}
public class TestDemo {
    public static void main(String[] args) {
        Animal animal1 = new Bird();
        animal1.eat();
        Bird bird = (Bird)animal1;
        bird.fly();
    }
}
